import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from 'typeorm'

@Entity('avatar')
export class Avatar {
  @PrimaryGeneratedColumn({ name: '_id' })
  _id: number

  @Column({ type: 'uuid', name: 'user_id' })
  user_id: string

  @Column({ type: 'longblob', name: 'avatar' })
  avatar: Buffer

  @Column({ type: 'varchar', length: 255, name: 'contentType' })
  contentType: string

  @CreateDateColumn({ name: 'create_time', type: 'timestamp' })
  createTime: Date
}
